package com.bawei.mall.user.controller;

import com.bawei.common.core.domain.R;
import com.bawei.mall.user.service.CusUserCollectService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName CusUserCollectController
 * @Description 描述
 * @Author ZiZheng.Li
 * @Date 2024/7/4 19:34
 */
@RestController
public class CusUserCollectController {
    @Autowired
    private CusUserCollectService cusUserCollectService;

    /**
     * 收藏商品
     */
    @PostMapping("/collectProductById/{id}")
    @ApiOperation("商品收藏")
    public R collectProductById(@PathVariable String id)
    {
        cusUserCollectService.collectMallProductInfoById(id);
        return R.ok();
    }

    /**
     * 取消收藏商品
     */
    @PostMapping("/deleteProductCollection/{id}")
    @ApiOperation("商品收藏")
    public R deleteProductCollection(@PathVariable String id)
    {
        cusUserCollectService.deleteProductCollection(id);
        return R.ok();
    }
}
